/*
 * @(#)EmployeeListAction.java   08/12/24
 *
 *
 */



package net.learntechnology.examples.stripes;

//~--- non-JDK imports --------------------------------------------------------

import com.google.inject.Inject;

import net.learntechnology.examples.domain.Employee;
import net.learntechnology.examples.service.EmployeeService;

import net.sourceforge.stripes.action.DefaultHandler;
import net.sourceforge.stripes.action.ForwardResolution;
import net.sourceforge.stripes.action.Resolution;
import net.sourceforge.stripes.action.UrlBinding;

//~--- JDK imports ------------------------------------------------------------

import java.util.List;

/**
 *
 * @author nmaves
 */
@UrlBinding("/employees")
public class EmployeeListAction extends BaseAction {
	private static final String EMPLOYEE_LIST = "/WEB-INF/jsp/employeeList.jsp";
	@Inject
	private EmployeeService     employeeService;
	private List<Employee>      employees;

	@DefaultHandler
	public Resolution list() {
		this.employees = employeeService.getAll();

		return new ForwardResolution(EMPLOYEE_LIST);
	}

	public List<Employee> getEmployees() {
		return employees;
	}

	public void setEmployees(List<Employee> employees) {
		this.employees = employees;
	}
}
